<!DOCTYPE html>
<html lang="en">

  <head>
    <meta charset="utf-8">
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0">
    <meta name="description" content="">
    <meta name="author" content="">
    <link rel="shortcut icon" href="images/favicon.png" type="image/png">

    <title>{$this->config->item('title_admincp')}</title>
    {css('style.default.css')}

    <!-- HTML5 shim and Respond.js IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    {js('html5shiv.js')}
    {js('respond.min.js')}
    <![endif]-->

    <!-- Define -->
    {assign var="template_admincp_url" value=''|template_admincp_url}
    {assign var="module" value=$this->router->fetch_module()}
    {assign var="controller" value=$this->router->fetch_class()}
    {assign var="action" value=$this->router->fetch_method()}
    {assign var="date_format_jquery" value=dateformat_PHP_to_jQuery($this->config->item('date_default'))}
    <script type="text/javascript">
    var $base_url='{$BASE_URL}';
    var $admincp_url='{$ADMIN_URL}';
    var $template_admincp_url='{$template_admincp_url}';
    var $app={
      'module':'{$module}',
      'controller':'{$controller}',
      'action':'{$action}'
    };
    var $data_lang = {$this->registry->get("language")|json_encode};
    var $date_format_jquery = '{$date_format_jquery}';
    </script>
  </head>

  <body>
    <!-- Preloader -->
    <div id="preloader">
      <div id="status"><i class="fa fa-spinner fa-spin"></i></div>
    </div>

    <section>

      <div class="leftpanel">

        <div class="logopanel">
          <h1><span>[</span> <a href="{$ADMIN_URL}users/edit/{$this->session->userdata('user_id')}">{$this->session->userdata('username')}</a> <span>]</span></h1>
        </div><!-- logopanel -->
        {include file='sidebar.tpl'}
      </div>

      <div class="mainpanel">

        <div class="headerbar">

          <a class="menutoggle"><i class="fa fa-bars"></i></a>

          <div class="header-right">
            <ul class="headermenu">            
              <li>
                <div class="btn-group">
                  <button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown">
                  	{image('photos/loggeduser.png')}
                    {$this->session->userdata('username')}
                    <span class="caret"></span>
                  </button>
                  <ul class="dropdown-menu dropdown-menu-usermenu pull-right">
                    <li><a href="{$ADMIN_URL}users/edit/{$this->session->userdata('user_id')}"><i class="glyphicon glyphicon-user"></i> {'profile'|trans}</a></li>
                    <li><a href="{$ADMIN_URL}logout"><i class="glyphicon glyphicon-log-out"></i> {'sign_out'|trans}</a></li>
                  </ul>
                </div>
              </li>
            </ul>
          </div><!-- header-right -->

        </div><!-- headerbar -->

        <div class="pageheader">
          <h2 id="date_time"></h2>
          <div class="breadcrumb-wrapper">
            <span class="label">{'caption_breadcrumb'|trans}</span>
            {$this->breadcrumbs->show()}
          </div>
        </div>

        <div class="contentpanel">
        	{block name=content}{/block}
        </div><!-- contentpanel -->

      </div><!-- mainpanel -->

    </section>
    {js('jquery-1.10.2.min.js')}
    {js('jquery-migrate-1.2.1.min.js')}
    {js('jquery-ui-1.10.3.min.js')}
    {js('bootstrap.min.js')}
    {js('modernizr.min.js')}
    {js('jquery.sparkline.min.js')}
    {js('toggles.min.js')}
    {js('retina.min.js')}
    {js('jquery.cookies.js')}

	  {js('flot/flot.min.js')}
    {js('flot/flot.resize.min.js')}
    {js('morris.min.js')}
    {js('raphael-2.1.0.min.js')}
    {js('moment.js')}

    {js('jquery.datatables.min.js')}
    {js('jquery.validate.min.js')}
    {js('jquery.filedrop.js')}
    {js('bootbox.min.js')}
    {js('plugins/forms/tinymce/tinymce.min.js')}
    {js('plugins/ui/jgrowl/jquery.jgrowl.min.js')}
    {js('plugins/upload/elfinder/elfinder.min.js')}
    {js('plugins/forms/select2/select2.js')}
    
    {if $this->session->flashdata('login') != ''}
    	{assign var="typeNoti" value='login'}
    	{assign var="dataNoti" value=$this->session->flashdata('login')}
   	{elseif $this->session->flashdata('success') != ''}
   		{assign var="typeNoti" value='success'}
    	{assign var="dataNoti" value=$this->session->flashdata('success')}
   	{elseif $this->session->flashdata('warning') != ''}
   		{assign var="typeNoti" value='warning'}
    	{assign var="dataNoti" value=$this->session->flashdata('warning')}
    {/if}
    
    <script type="text/javascript">
      $(document).ready(function() {
        var typeNoti = "{$typeNoti}";
        var dataNoti = "{$dataNoti}";
        switch(typeNoti){
          case "login": 
          $.jGrowl("<i class='icon16 i-checkmark-3'></i> "+dataNoti, {
            group: 'success',
            position: 'center',
            sticky: false,
            closeTemplate: '<i class="icon16 i-close-2"></i>',
            animateOpen: {
              width: 'show',
              height: 'show'
            }
          });
          break;
          case "success": 
          $.jGrowl("<i class='icon16 i-checkmark-3'></i> "+dataNoti, {
            group: 'success',
            closeTemplate: '<i class="icon16 i-close-2"></i>',
            animateOpen: {
              width: 'show',
              height: 'show'
            }
          });
          break;
          case "warning": 
          $.jGrowl("<i class='icon16 i-warning-2'></i> "+dataNoti, {
            group: 'warning',
            closeTemplate: '<i class="icon16 i-close-2"></i>',
            animateOpen: {
              width: 'show',
              height: 'show'
            }
          });
          break;
          default:
          break;
        }
      })
    </script>
    <script data-main="{$BASE_URL}assets/apps/backend/main" src="{$BASE_URL}assets/bundles/require.js"></script>
  </body>


</html>
